import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {RouterModule, Routes} from '@angular/router';
import {CrisislistComponent} from './crisislist/crisislist.component';
import {CrisisCenterdefultComponent} from './crisis-centerdefult/crisis-centerdefult.component';
import {CrisisdetaildefultComponent} from './crisisdetaildefult/crisisdetaildefult.component';
import {CrisisdetailComponent} from './crisisdetail/crisisdetail.component';

import {CherodetailService} from '../service/cherodetailService/cherodetail.service';
const crisisRotes: Routes = [


  {
    path: '',
    component: CrisisCenterdefultComponent,
    children: [
      {
        path: ':id',
        component: CrisisdetailComponent,
        // canDeactivate: [CanDeactivateGuard],
        resolve: {
          crisis: CherodetailService
        }
      },


      {

        path: '',
        component: CrisislistComponent,
        children: [{path: '', component: CrisisdetaildefultComponent}]


      }]


  }]
;


@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(crisisRotes)
  ],
  exports: [RouterModule],
  providers: [CherodetailService]
})
export class CrisisRoutingModule {
}
